package com.yksj.healthtalk.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class ServerCollectionEntity implements Serializable {
//         "MERCHANT_ID": 1,
//         "MERCHANT_NAME": "药品服务中心",
//         "COLLECTION_ICON": "/houseandoid/save_I4house10.png",
//         "PROP_ID": 2406
     
    private String COLLECTION_ICON;
	private String MERCHANT_NAME;
	private String MERCHANT_ID;
	private String PROP_ID;
	public String getMERCHANT_NAME() {
		return MERCHANT_NAME;
	}
	
	public String getCOLLECTION_ICON() {
		return COLLECTION_ICON;
	}

	public void setCOLLECTION_ICON(String cOLLECTION_ICON) {
		COLLECTION_ICON = cOLLECTION_ICON;
	}

	public void setMERCHANT_NAME(String mERCHANT_NAME) {
		MERCHANT_NAME = mERCHANT_NAME;
	}
	public String getMERCHANT_ID() {
		return MERCHANT_ID;
	}
	public void setMERCHANT_ID(String mERCHANT_ID) {
		MERCHANT_ID = mERCHANT_ID;
	}
	public String getPROP_ID() {
		return PROP_ID;
	}
	public void setPROP_ID(String pROP_ID) {
		PROP_ID = pROP_ID;
	}
	
	public static List<ServerCollectionEntity> parseToList(JSONArray array){
		List<ServerCollectionEntity> entities=null;
		try {
			entities=new ArrayList<ServerCollectionEntity>();
			for (int i = 0; i < array.length(); i++) {
					ServerCollectionEntity entity=new ServerCollectionEntity();
					JSONObject object=(JSONObject) array.get(i);
					entity.setMERCHANT_ID(object.optString("MERCHANT_ID",""));
					entity.setMERCHANT_NAME(object.optString("MERCHANT_NAME",""));
					entity.setPROP_ID(object.optString("PROP_ID",""));
					entity.setCOLLECTION_ICON(object.optString("COLLECTION_ICON",""));
					entities.add(entity);
			}
		} catch (JSONException e) {
		}
		return entities;
	}
	
	
}
